use lapin::{Channel, Connection, ConnectionProperties};

/// 获取channel
pub async fn get_channel() -> anyhow::Result<Channel> {
    // 连接rabbitmq   协议://用户名:密码@host:端口/虚拟地址
    let addr = "amqp://admin:123456@172.28.217.80:5672/dev";
    let conn = Connection::connect(&addr, ConnectionProperties::default()).await?;
    // 创建通道
    let channel = conn.create_channel().await?;
    Ok(channel)
}
